import {Table,Rate} from 'antd'
import './detailtable.css'
interface PropsType{
    name:string;
    price:string|number;
    discount:string|number;
    sale:string;
    rate:number;
    originalPrice:string|number;
}
const DeatilTable:React.FC<PropsType>=({name,price,discount,rate,originalPrice})=>{
    const columns = [
        {
            title: 'title',
            dataIndex: 'title',
            key: 'title',
        },
        {
            title: 'description',
            dataIndex: 'description',
            key: 'description',
        }
    ];
    const dataSource = [
        {
            key: '1',
            title: '路线名称',
            description: name,
        },
        {
            key: '2',
            title: '价格',
            description:<div>¥ <span className="now">{originalPrice}</span></div>
        },
        {
            key: '3',
            title: '限时抢购折扣',
            description: discount,
        },
        {
            key: '4',
            title: '领取优惠',
            description: <div>¥ <span className="before">{originalPrice}</span> ¥<span className="now">{price}</span></div>
        },
        {
            key: '5',
            title: '路线路评价',
            description: <Rate allowHalf defaultValue={rate} />
        }

    ];
    return(
        <div className="detailtable">
            <Table dataSource={dataSource} columns={columns} pagination={false}/>
        </div>
    )
}
export default DeatilTable